local fengying = fk.CreateSkill{
    name = "new_ld__fengying",
    tags = { Skill.Limited },
}

local H = require "packages.ol_hegemony.util"

fengying:addEffect("active",{
    anim_type = "special",
    card_num = 0,
    target_num = 0,
    prompt = "#new_ld__fengying-active",
    card_filter = Util.FalseFunc,
    target_filter = Util.FalseFunc,
    can_use = function(self, player)
       return player:usedSkillTimes(fengying.name, Player.HistoryGame) == 0 and not player:isKongcheng() and not player:prohibitUse(Fk:cloneCard("threaten_emperor"))
    end,
    on_use = function(self, room, effect)
    local player = effect.from
    room:useVirtualCard("threaten_emperor", player:getCardIds("h"), player, player, fengying.name)
    local targets = table.filter(room.alive_players, function(p) return H.compareKingdomWith(p, player) end)
    if #targets > 0 then
      for _, p in ipairs(targets) do
        if not p.dead then
          p:drawCards(math.max(0, p.maxHp - p:getHandcardNum()), fengying.name)
        end
      end
    end
  end,
})

Fk:loadTranslationTable{
    ["new_ld__fengying"] = "奉迎",
    [":new_ld__fengying"] = "限定技，出牌阶段，你可将所有手牌当【挟天子以令诸侯】（无视大势力限制）使用，然后所有与你势力相同的角色将手牌补至其体力上限。",

    ["#new_ld__fengying-active"] = "奉迎：你可将所有手牌当【挟天子以令诸侯】（无视大势力限制）使用",
    ["$new_ld__fengying1"] = "二臣恭奉，以迎皇嗣。",
    ["$new_ld__fengying2"] = "奉旨典选，以迎忠良。",
}

return fengying